package org.apache.mf.config;

import org.apache.mf.service.impl.SmsServiceImpl;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @Author: kyrie  @date: 2023/1/28 16:51
 * @Description: 配置加载类
 * @Package: org.apache.mf.config
 */
@Configuration
@EnableConfigurationProperties({SmsProperties.class})
public class SmsAutoConfig {
    @Resource
    private SmsProperties smsProperties;

    @Bean
    public SmsServiceImpl smsServiceImpl() {
        return new SmsServiceImpl(smsProperties.getAccessKeyId(), smsProperties.getAccessKeySecret());
    }
}
